<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <iframe src="child.html" frameborder="0"></iframe>
</body>
<script>
    // function parentMethod(){
    //     console.log('父节点被触发')
    //     console.log('token内容：'+localStorage.getItem("lastname"))
    // }
    window.addEventListener('message', function(e){
　　//处理消息
    console.log('触发',e.data)
    }, false);
</script>
</html>
